<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="<%= (@cols + 2) * 8.433333333 %>" height="<%= (@rows + 1) * 14 * 1.4 %>" font-family="<%= @font_family || "Consolas, Menlo, 'Bitstream Vera Sans Mono', monospace, 'Powerline Symbols'" %>" font-size="14px">
<style>
<%= render "_svg_theme_#{@theme_name}.css" %>
<%= render "_svg_256_colors.css" %>
.br { font-weight: bold }
.it { font-style: italic }
.un { text-decoration: underline }
</style>

<rect width="100%" height="100%" class="default-bg-fill" rx="<%= assigns[:rx] || 4 %>" ry="<%= assigns[:ry] || 4 %>" />

<svg x="<%= percent(1.0 * 100 / (@cols + 2)) %>" y="<%= percent(0.5 * 100 / (@rows + 1)) %>" class="default-text-fill">
<g style="shape-rendering: optimizeSpeed">
<%= for %{y: y, chunks: chunks} <- @bg_lines do %><%= for chunk <- chunks do %><%= c = svg_rect_class(chunk.attrs); s = svg_rect_style(chunk.attrs); if c || s do %><rect x="<%= percent(100 * chunk.x / (@cols + 2)) %>" y="<%= percent(100 * y / (@rows + 1)) %>" width="<%= percent(100 * chunk.width / (@cols + 2)) %>" height="19.7"<%= if c do %> class="<%= c %>"<% end %><%= if s do %> style="<%= s %>"<% end %> />
<% end %><% end %><% end %></g>

<text class="default-text-fill">
<%= for %{y: y, chunks: chunks} <- @text_lines do %><tspan y="<%= percent(100 * y / (@rows + 1)) %>">
<%= for {chunk, i} <- Enum.with_index(chunks) do %><tspan<%= if i == 0 do %> dy="1em"<% end %> x="<%= percent(100 * chunk.x / (@cols + 2)) %>"<%= if c = svg_text_class(chunk.attrs) do %> class="<%= c %>"<% end %><%= if s = svg_text_style(chunk.attrs) do %> style="<%= s %>"<% end %>><%= safe_to_string(html_escape(chunk.text)) %></tspan><% end %>
</tspan>
<% end %>
</text>

<g transform="translate(-50 -50)">
<svg x="50%" y="50%" width="100" height="100">
<%= render "_logo.svg" %>
</svg>
</g>
</svg>
</svg>
